Skip to content

chore: lib upgrades for trivy issues#1705

Closed
ohnorobo wants to merge 1 commit into
laplante/version-upgradesfrom
laplante/version-upgrades2
Closed

chore: lib upgrades for trivy issues#1705
ohnorobo wants to merge 1 commit into
laplante/version-upgradesfrom
laplante/version-upgrades2

Conversation

@ohnorobo

@ohnorobo ohnorobo commented May 11, 2026

Copy link
Copy Markdown
Contributor

Further upgrades for lib version security issues surfaced by Trivy

  • upgrades Prometheus 2.53.4 → 3.5.3 (LTS)
  • removes unneeded npm from the docker image.

@ohnorobo ohnorobo changed the title lib upgrades for trivy issues chore: lib upgrades for trivy issues May 11, 2026
@ohnorobo ohnorobo marked this pull request as ready for review May 11, 2026 11:29
@ohnorobo ohnorobo requested review from a team and fortuna as code owners May 11, 2026 11:29
@greptile-apps

greptile-apps Bot commented May 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR addresses Trivy-reported vulnerabilities by upgrading the bundled Prometheus binary from 2.53.4 to 3.5.3 (LTS) and removing npm/npx from the runtime Docker image.

  • Prometheus 3.5.3 upgrade: SHA256 hashes for all four architectures (linux/amd64, darwin/amd64, darwin/arm64) were verified against the official Prometheus download page. All CLI flags currently used (--config.file, --web.enable-admin-api, --storage.tsdb.retention.time, --storage.tsdb.path, --web.listen-address, --log.level) remain valid in Prometheus v3; the scrape configuration format and API endpoints (/api/v1/query, /api/v1/query_range, /api/v1/status/flags) are unchanged.
  • npm/npx removal from Docker image: cmd.sh only invokes node directly, so stripping /usr/local/lib/node_modules/npm and the npm/npx symlinks is safe and reduces the image's vulnerability surface.

Confidence Score: 5/5

Safe to merge — the Prometheus v3 flags and scrape config used by the codebase are unchanged, SHA256 hashes are verified, and the npm removal does not affect the runtime entrypoint.

The diff touches only two well-scoped concerns: a version bump with verified checksums and a surface-reduction in the Docker image. All CLI flags passed to Prometheus are confirmed valid in v3, the scrape config format is unchanged, and the runtime entrypoint (cmd.sh) never calls npm or npx.

No files require special attention.

Important Files Changed

Filename Overview
src/shadowbox/docker/Dockerfile Adds a rm -rf step to strip npm/npx from the runtime image; safe since cmd.sh only invokes node directly.
third_party/Taskfile.yml Bumps Prometheus download version to 3.5.3 and replaces all four architecture SHA256 hashes; hashes verified against official Prometheus download page.
third_party/prometheus/METADATA Updates archive URLs and metadata to reflect the new v3.5.3 release and today's upgrade date; no issues found.

Reviews (1): Last reviewed commit: "lib upgrades for trivy issues" | Re-trigger Greptile

Comment thread third_party/Taskfile.yml
desc: Download and extract prometheus binary
vars:
VERSION: '2.53.4'
VERSION: '3.5.3'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a major version change. Will it be able to read the v2 data? If so, we need a migration step.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, it does require at least thinking through the implications of https://prometheus.io/docs/prometheus/latest/migration/

# safely grab the ip-to-country database.
RUN apk upgrade --no-cache && apk add --no-cache --upgrade coreutils curl
# Remove npm/npx CLI — the runtime only invokes `node`, and npm ships old transitive deps that
# trip image vulnerability scanners.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, we don't have to over-index in vulnerability scanners if they are not exploitable. There's a ton of false-positives. I would imagine that a new node image would address that. Why don't you upgrade the node image instead?

@ohnorobo

Copy link
Copy Markdown
Contributor Author

Yeah, I split this out because it came up while I was working on #1704 but I agree that there's no pressing need to do these upgrades. Particularly if they require deeper migration planning we can drop this one for now.

@ohnorobo ohnorobo closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants